<?php

namespace App\Admin\Actions\Post;

use Encore\Admin\Actions\RowAction;
use Illuminate\Database\Eloquent\Model;

class RefuseAuditFail extends RowAction
{
    public $name = '取消';

    public function handle(Model $model)
    {
        if( $model->status == 32 ){
            $model->status = 35;
            $model->refuse_status = 0;
            $model->save();
        }

        return $this->response()->success('已取消')->refresh();
    }

}